1 <?
2 if
(isset($_POST['butSaveLoai'])) {
3     $products_id=$_POST[
'txtProductid'];
4     $sort = $_POST[
'txtSortOrder'];
5     $status=($_POST[
'chkShow']!=''?1:0);
6                 
7     $ten = trim($_POST[
'txtName']);
8     
if ($products_id=="")
9     {
10         echo
"<p align=center class='err'>B&#7841;n ch&#432;a ch&#7885;n mã s&#7843;n ph&#7849;m</p>";
11     }
12     
else
13     {
14         
if (!empty($_POST['oldid'])) {
15             $oldid = $_POST[
'oldid'];
16             $sql =
"update news_hot set news_id='".$products_id."', ns_sortorder='".$sort."', ns_status=".$status." where ns_id='".$oldid."'";
17         }
18         
else
19             $sql =
"insert into news_hot (news_id, ns_sortorder, ns_status) values ('".$products_id."','".$sort."',".$status.")";
20         
if (mysql_query($sql,$con)) {
21             echo
"<p align=center class='err'>&#272;ã c&#7853;p nh&#7853;t thành công</p><br>";
22             echo
"<script>window.location='index.php?act=news_hot&page=".$_REQUEST['page']."'</script>";
23         }
24         
else echo "<p align=center class='err'>Không th&#7875; c&#7853;p nh&#7853;t</p>";
25     }
26 }
27 ?>
28
29 <?
30     
if (isset($_GET['id'])) {
31         $oldid=$_GET[
'id'];
32         $sql =
"select * from news_hot where ns_id='".$oldid."'";
33         
if ($result = mysql_query($sql,$con)) {
34             $row=mysql_fetch_array($result);
35             $products_id=$row[
'news_id'];
36             $order=$row[
'ns_sortorder'];
37             $status=$row[
'ns_status'];
38             $date=$row[
'ns_dateadded'];
39         }
40     }
41 ?>
42
43 <form method=
"POST" name="FormLoaiSP" action="index.php">
44 <input type=hidden name=
"act" value="news_hot_m">
45 <input type=hidden name=
"oldid" value="<? echo $oldid; ?>">
46 <input type=hidden name=
"page" value="<? echo $_REQUEST['page']; ?>">
47 <table border=
"1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
48   <tr>
49     <td width=
"45%" align="center" class="title" height="20">S&#7917;a &#273;&#7893;i / C&#7853;p nh&#7853;t
50     : Tin m&#
7899;i</td>
51   </tr>
52   <tr>
53     <td width=
"45%">
54     <table border=
"0" cellpadding="4" bordercolor="#111111" width="124%" id="AutoNumber2" cellspacing="0">
55       <tr>
56         <td width=
"15%" class="smallfont">
57         <p align=
"right">Mã</td>
58         <td width=
"1%" class="smallfont">
59         <font color=
"#FF0000">*</font></td>
60         <td width=
"83%" class="smallfont">
61         <INPUT
readonly value="<? echo $products_id; ?>" TYPE="text" NAME="txtProductid" CLASS=textbox size="34"></td>
62       </tr>
63       <tr>
64         <td width=
"15%" class="smallfont" align="right">
65         Không hi&#
7875;n th&#7883;</td>
66         <td width=
"1%" class="smallfont" align="right">
67         &nbsp;</td>
68         <td width=
"83%" class="smallfont">
69         <input type=
"checkbox" name="chkShow" value="ON" <? if ($status>0) echo 'checked' ?>></td>
70       </tr>
71       <tr>
72         <td width=
"15%" class="smallfont" align="right">
73         Th&#
7913; t&#7921; s&#7855;p x&#7871;p</td>
74         <td width=
"1%" class="smallfont" align="right">
75         &nbsp;</td>
76         <td width=
"83%" class="smallfont">
77         <INPUT
value="<? echo $order; ?>" TYPE="text" NAME="txtSortOrder" CLASS=textbox size="34"></td>
78       </tr>
79       <tr>
80         <td width=
"15%" class="smallfont">
81         <p align=
"right">
82         <INPUT TYPE=
"submit" NAME="butSaveLoai" VALUE="C&#7853;p nh&#7853;t" CLASS=button>&nbsp;</td>
83         <td width=
"1%" class="smallfont">
84         &nbsp;</td>
85         <td width=
"83%" class="smallfont"><p align="left">&nbsp;<INPUT TYPE="reset" CLASS=button value="Nh&#7853;p l&#7841;i"></td>
86       </tr>
87     </table>
88     </td>
89   </tr>
90   </table>
91 </form>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.902 lượt xem

Gõ tìm kiếm nhanh...